class Application
{
public:
    void InitParameters();
    void Init();
    void Draw();
    void Step();
    void KeyDown(int key);
    void KeyUp(int key);

    inline const AppParameters& Parameters() const
    {
        return _parameters;
    }

private:
    Game* GameFromName(const string &name);

    AppParameters _parameters;

    Game *_activeGame;
    
    Bitmap _frameBufferA;
    Bitmap _frameBufferB;
    GLTexture *_frameTextureA;
    GLTexture *_frameTextureB;

    ControllerState _controller;

    bool _useAI;
    
    Replay _replay;

    int _replayIndex;
    int _replayFrameIndex;
    ReplayCollection _allReplays;
    GameModel _activeModel;

    int _testingBaseFrame;
    int _testingLookAhead;
    list<const Frame*> _testingFrames;
    vector<Frame> _predictedFrames;

    SarsaCoordinator *_onlineLearningCoordinator;

    int _movieFrame;
};
